package com.aba.cms.teacher;

import java.util.ArrayList;
import java.util.List;

public class Teacher {
    private int id;
    private String name;
    private String department;
    private String title;
    private String phone;
    private String email;
    private List<Course> courses;

    public Teacher() {
        this.courses = new ArrayList<>();
    }

    public Teacher(int id, String name, String department, String title, String phone, String email) {
        this.id = id;
        this.name = name;
        this.department = department;
        this.title = title;
        this.phone = phone;
        this.email = email;
        this.courses = new ArrayList<>();
    }

    // Getters and Setters
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public String getDepartment() { return department; }
    public void setDepartment(String department) { this.department = department; }
    public String getTitle() { return title; }
    public void setTitle(String title) { this.title = title; }
    public String getPhone() { return phone; }
    public void setPhone(String phone) { this.phone = phone; }
    public String getEmail() { return email; }
    public void setEmail(String email) { this.email = email; }
    public List<Course> getCourses() { return courses; }
    public void setCourses(List<Course> courses) { this.courses = courses; }
    
    public void addCourse(Course course) {
        this.courses.add(course);
    }

    @Override
    public String toString() {
        return "教师ID: " + id +
               ", 姓名: " + name +
               ", 院系: " + department +
               ", 职称: " + title +
               ", 电话: " + phone +
               ", 邮箱: " + email;
    }
}    